/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024.
 * Description: rtos exception table head file
 * Author: wanglinhui <wanglinhui@huawei.com>
 * Create: 2024-06-13
 */

#ifndef RTOS_EXTABLE_H
#define RTOS_EXTABLE_H

#include <asm/types.h>

#ifndef __ASSEMBLY__

extern bool fixup_exception_rtos(struct pt_regs *regs);

	/*
	 * rtos_ex_entry - place-relative extable entry
	 */
asm(".macro		rtos_ex_entry, insn, fixup\n"
	".pushsection	__rtos_ex_table, \"a\", %progbits\n"
	".align		3\n"
	".long		\\insn - .\n"
	".long		\\fixup - .\n"
	".popsection\n"
	".endm\n");

#else

	/*
	 * rtos_ex_entry - place-relative extable entry
	 */
	.macro		rtos_ex_entry, insn, fixup
	.pushsection	__rtos_ex_table, "a", % progbits
	.align		3
	.long		\insn - .
	.long		\fixup - .
	.popsection
	.endm

#endif
#endif /* RTOS_EXTABLE_H */
